#ifndef EXPRNODE_H
#define EXPRNODE_H

#include <string>

class ExprNode
{
public:
    enum Type { Number = 0, Operator = 1};
    union { double number_; char operator_;} content{};
    Type type;
    ExprNode(double num) { content.number_ = num; type = Number; }
    ExprNode(int num) { content.number_ = num; type = Number; }
    ExprNode(char c) { content.operator_ = c; type = Operator; }
    [[nodiscard]] std::string GetString() const
    {
        if(type == Operator) return std::string(&content.operator_);
        return std::to_string(content.number_);
    }
};


#endif //EXPRNODE_H
